// Dom7
var $$ = Dom7;

// Framework7 App main instance
var app = new Framework7({
    root: '#app', // App root element
    id: 'io.framework7.testapp', // App bundle ID
    name: 'Framework7', // App name
    theme: 'ios', // Automatic theme detection
    view: {
        stackPages: true, // 多级页面缓存
        pushState: true, // 开启 url 根据路由 hash 变化
    },
    // App root data
    data: function() {
        return {};
    },
});

app.preloader.show();

// Init/Create views
var homeView = app.views.create('.view-main', {
    url: '/'
});

function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
var href = getQueryString('href')

// setTimeout(function() {
//     app.preloader.hide();
//     window.location.href = href
// }, 1000);

app.preloader.hide();
window.location.href = href

// setTimeout(function() {
//     window.location.href = href
// }, 2000);


$$('.back').on('click', function() {
    history.go(-1); // 也是返回当前页的上一页， 不过表单里的数据全部还在
});

$$('#reload').on('click', function() {
    window.location.href = href
});
//